public class doublearray {
    public static void main(String[] args) {
        //静态初始化
        int[][] arr1 = new int[][]{{1, 2, 3},
                {3, 4, 2, 3, 5}
        };
        System.out.println(arr1[0]);//  获取的是第一个一维数组的地址
        System.out.println(arr1[1][0]);//具体数字

        //遍历
        for (int i = 0; i < arr1.length; i++) {
            for(int j = 0; j < arr1[i].length; j++) {
                System.out.print(arr1[i][j] + " ");
            }
        }
System.out.println("\n");
        //动态初始化
        int [][] arr2 = new int[3][3];
        for (int i = 0; i < arr2.length; i++) {
            for (int j = 0; j < arr2[i].length; j++) {
                System.out.print(arr2[i][j] + " ");
            }
        }
    }
}